//
//  NovelThreeCollectionViewCell.m
//  novel
//
//  Created by 高青松 on 2018/8/11.
//  Copyright © 2018年 Tracy. All rights reserved.
//

#import "NovelThreeCollectionViewCell.h"

@implementation NovelThreeCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self.contentView addSubview:self.iconImgView];
        [self.contentView addSubview:self.titleLabel];
        
        [self.iconImgView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(self);
            make.top.equalTo(self);
            make.left.equalTo(self).offset(10 * kProportionW);
            make.right.equalTo(self).offset(-10 * kProportionW);
            make.height.equalTo(@(130 * kProportionW));
        }];
        
        [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.iconImgView);
            make.right.bottom.equalTo(self);
            make.top.equalTo(self.iconImgView.mas_bottom);
        }];
        
    }
    return self;
}


#pragma mark  --setter--
- (UIImageView *)iconImgView
{
    if (!_iconImgView) {
        self.iconImgView = [UIImageView new];
        [self.iconImgView setImage:[UIImage imageNamed:@"Host_CollectionViewCell_placeholderImg"]];
        self.iconImgView.backgroundColor = [UIColor whiteColor];
        self.iconImgView.contentMode = UIViewContentModeScaleAspectFit;
    }
    return _iconImgView;
}

- (UILabel *)titleLabel{
    if (!_titleLabel) {
        self.titleLabel = [UILabel new];
        self.titleLabel.textColor = TINTCOLOR;
        self.titleLabel.font = [UIFont systemFontOfSize:13 * kProportionW];
        self.titleLabel.text = @"模式为皇";
        self.titleLabel.textAlignment = NSTextAlignmentLeft;
    }
    return _titleLabel;
}

@end
